<div class="accordion" fillSpace="sideBar">
<?php foreach ($menus as $item):?>
	<div class="accordionHeader">
		<h2>
			<span>Folder</span>
			<?php echo $item->title?>
		</h2>
	</div>
	<div class="accordionContent">
		<ul class="tree treeFolder">
		<?php foreach ($item->child as $child):?>
		<?php if (count($child->child) > 0):?>
			<li><a href="javascript:;"><?php echo $child->title?> </a>
				<ul>
				<?php foreach ($child->child as $child2):?>
				<?php if ($child2->isout):?>
					<li><a href="<?php echo $child2->url?>" mask="true" target="<?php echo $child2->target?>"><?php echo $child2->title?>
					</a></li>
					<?php else:
					$context = QContext::instance();
					$udi = $context->normalizeUDI($child2->url);
					$menus_obj = Functions::find('module = ? and namespace = ? and controller =? and action = ?',$udi['module'],$udi['ns'],$udi['controller'],$udi['action'])->getOne();
					if ($menus_obj->ispower){
						if (isset($power[$udi['module']][$udi['ns']][$udi['controller']][$udi['action']]))
						{
							?>
					<li><a href="<?php echo url($child2->url,null,null,array('mode'=>'standard')).$child2->param?>" mask="true" target="<?php echo $child2->target?>" rel="<?php echo $child2->title?>" height="500"><?php echo $child2->title?>
					</a></li>
					<?php
						}
					}else{
						?>
					<li><a href="<?php echo url($child2->url,null,null,array('mode'=>'standard')).$child2->param?>" mask="true" target="<?php echo $child2->target?>" rel="<?php echo $child2->title?>" height="500"><?php echo $child2->title?>
					</a></li>
					<?php };endif;?>
					<?php endforeach;?>
				</ul>
			</li>
			<?php else:?>
			<?php if ($child->isout):?>
			<li><a href="<?php echo $child->url?>" mask="true" target="<?php echo $child->target?>" height="500"><?php echo $child->title?>
			</a></li>
			<?php else:
			$context = QContext::instance();
			$udi = $context->normalizeUDI($child->url);
			$menus_obj = Functions::find('module = ? and namespace = ? and controller =? and action = ?',$udi['module'],$udi['ns'],$udi['controller'],$udi['action'])->getOne();
			if ($menus_obj->ispower){
				if (isset($power[$udi['module']][$udi['ns']][$udi['controller']][$udi['action']]))
				{
					?>
			<li><a href="<?php echo url($child->url,null,null,array('mode'=>'standard')).$child->param?>" rel="<?php echo $child->title?>" mask="true" target="<?php echo $child->target?>" height="500"><?php echo $child->title?>
			</a></li>
			<?php
				}
			}else{
				?>
			<li><a href="<?php echo url($child->url,null,null,array('mode'=>'standard')).$child->param?>" rel="<?php echo $child->title?>" mask="true" target="<?php echo $child->target?>" height="500"><?php echo $child->title?>
			</a></li>
			<?php };endif;?>
			<?php endif;?>
			<?php endforeach;?>
		</ul>
	</div>
	<?php endforeach;?>
</div>
